package com.itstyle.quartz.web;


import com.itstyle.quartz.entity.Result;
import com.itstyle.quartz.entity.SignInLog;
import com.itstyle.quartz.service.ISignInLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class SignInLogController {

    @Autowired
    private ISignInLogService signInLogService;


    @PostMapping("/list")
    public Result list(SignInLog signInLog, Integer pageNo, Integer pageSize) {
        return signInLogService.listSignInLog(signInLog, pageNo, pageSize);
    }

    @PostMapping("/remove")
    public Result remove(SignInLog signInLog) {
        try {
            signInLogService.delete(signInLog);
        } catch (Exception e) {
            e.printStackTrace();
            Result.error();
        }
        return Result.ok();
    }

}
